import { createStore } from "vuex";
import { getShopApi } from "../utils/apis";

export default createStore({
  state: {
    shopList: [],
  },
  mutations: {
    changeShop(state, payload) {
      state.shopList = payload.data.result;
    },
  },
  actions: {
    async changeShopAsync({ commit }) {
      const res = await getShopApi();
      commit("changeShop", res);
    },
  },
  modules: {},
});
